//
//  UIAspect.h
//  SulitLoanDemo
//
//  Created by 虞嘉伟 on 2025/2/18.
//  
  

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

inline static CGFloat aspectValue(CGFloat x) {
    return MIN(UIScreen.mainScreen.bounds.size.width, UIScreen.mainScreen.bounds.size.height) / 414.0 * x;
}

inline static CGFloat aspectVerticalValue(CGFloat x) {
    return MAX(UIScreen.mainScreen.bounds.size.width, UIScreen.mainScreen.bounds.size.height) / 896.0 * x;
}

inline static UIFont *aspectFont(NSString *name, CGFloat size) {
    return [UIFont fontWithName:name size:aspectValue(size)];
}

inline static UIFont *aspectDefaultFont(CGFloat size) {
    return [UIFont systemFontOfSize:aspectValue(size)];
}

inline static UIFont *aspectBoldFont(CGFloat size) {
    return [UIFont systemFontOfSize:aspectValue(size) weight:UIFontWeightBold];
}


NS_ASSUME_NONNULL_END
